import VueRouter from 'vue-router'

//引入组件
import Index from '../pages'
import Home from '../pages/home/home'
import Login from '../pages/login/login'
import Register from '../pages/register/register'
import Center from '../pages/center/center'
import Messages from '../pages/messages/list'
import Storeup from '../pages/storeup/list'
import News from '../pages/news/news-list'
import NewsDetail from '../pages/news/news-detail'
import payList from '../pages/pay'

import yonghuList from '../pages/yonghu/list'
import yonghuDetail from '../pages/yonghu/detail'
import yonghuAdd from '../pages/yonghu/add'
import kefangleixingList from '../pages/kefangleixing/list'
import kefangleixingDetail from '../pages/kefangleixing/detail'
import kefangleixingAdd from '../pages/kefangleixing/add'
import jiudiankefangList from '../pages/jiudiankefang/list'
import jiudiankefangDetail from '../pages/jiudiankefang/detail'
import jiudiankefangAdd from '../pages/jiudiankefang/add'
import kefangyudingList from '../pages/kefangyuding/list'
import kefangyudingDetail from '../pages/kefangyuding/detail'
import kefangyudingAdd from '../pages/kefangyuding/add'
import ruzhudengjiList from '../pages/ruzhudengji/list'
import ruzhudengjiDetail from '../pages/ruzhudengji/detail'
import ruzhudengjiAdd from '../pages/ruzhudengji/add'
import xudingList from '../pages/xuding/list'
import xudingDetail from '../pages/xuding/detail'
import xudingAdd from '../pages/xuding/add'
import tuifangList from '../pages/tuifang/list'
import tuifangDetail from '../pages/tuifang/detail'
import tuifangAdd from '../pages/tuifang/add'
import newstypeList from '../pages/newstype/list'
import newstypeDetail from '../pages/newstype/detail'
import newstypeAdd from '../pages/newstype/add'
import aboutusList from '../pages/aboutus/list'
import aboutusDetail from '../pages/aboutus/detail'
import aboutusAdd from '../pages/aboutus/add'
import systemintroList from '../pages/systemintro/list'
import systemintroDetail from '../pages/systemintro/detail'
import systemintroAdd from '../pages/systemintro/add'
import discussjiudiankefangList from '../pages/discussjiudiankefang/list'
import discussjiudiankefangDetail from '../pages/discussjiudiankefang/detail'
import discussjiudiankefangAdd from '../pages/discussjiudiankefang/add'

const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
	return originalPush.call(this, location).catch(err => err)
}

//配置路由
export default new VueRouter({
	routes:[
		{
      path: '/',
      redirect: '/index/home'
    },
		{
			path: '/index',
			component: Index,
			children:[
				{
					path: 'home',
					component: Home
				},
				{
					path: 'center',
					component: Center,
				},
				{
					path: 'pay',
					component: payList,
				},
				{
					path: 'messages',
					component: Messages
				},
				{
					path: 'storeup',
					component: Storeup
				},
				{
					path: 'news',
					component: News
				},
				{
					path: 'newsDetail',
					component: NewsDetail
				},
				{
					path: 'yonghu',
					component: yonghuList
				},
				{
					path: 'yonghuDetail',
					component: yonghuDetail
				},
				{
					path: 'yonghuAdd',
					component: yonghuAdd
				},
				{
					path: 'kefangleixing',
					component: kefangleixingList
				},
				{
					path: 'kefangleixingDetail',
					component: kefangleixingDetail
				},
				{
					path: 'kefangleixingAdd',
					component: kefangleixingAdd
				},
				{
					path: 'jiudiankefang',
					component: jiudiankefangList
				},
				{
					path: 'jiudiankefangDetail',
					component: jiudiankefangDetail
				},
				{
					path: 'jiudiankefangAdd',
					component: jiudiankefangAdd
				},
				{
					path: 'kefangyuding',
					component: kefangyudingList
				},
				{
					path: 'kefangyudingDetail',
					component: kefangyudingDetail
				},
				{
					path: 'kefangyudingAdd',
					component: kefangyudingAdd
				},
				{
					path: 'ruzhudengji',
					component: ruzhudengjiList
				},
				{
					path: 'ruzhudengjiDetail',
					component: ruzhudengjiDetail
				},
				{
					path: 'ruzhudengjiAdd',
					component: ruzhudengjiAdd
				},
				{
					path: 'xuding',
					component: xudingList
				},
				{
					path: 'xudingDetail',
					component: xudingDetail
				},
				{
					path: 'xudingAdd',
					component: xudingAdd
				},
				{
					path: 'tuifang',
					component: tuifangList
				},
				{
					path: 'tuifangDetail',
					component: tuifangDetail
				},
				{
					path: 'tuifangAdd',
					component: tuifangAdd
				},
				{
					path: 'newstype',
					component: newstypeList
				},
				{
					path: 'newstypeDetail',
					component: newstypeDetail
				},
				{
					path: 'newstypeAdd',
					component: newstypeAdd
				},
				{
					path: 'aboutus',
					component: aboutusList
				},
				{
					path: 'aboutusDetail',
					component: aboutusDetail
				},
				{
					path: 'aboutusAdd',
					component: aboutusAdd
				},
				{
					path: 'systemintro',
					component: systemintroList
				},
				{
					path: 'systemintroDetail',
					component: systemintroDetail
				},
				{
					path: 'systemintroAdd',
					component: systemintroAdd
				},
				{
					path: 'discussjiudiankefang',
					component: discussjiudiankefangList
				},
				{
					path: 'discussjiudiankefangDetail',
					component: discussjiudiankefangDetail
				},
				{
					path: 'discussjiudiankefangAdd',
					component: discussjiudiankefangAdd
				},
			]
		},
		{
			path: '/login',
			component: Login
		},
		{
			path: '/register',
			component: Register
		},
	]
})
